/* Handles events in the application: Start, Exit, Pause, KeyDown, KeyUp

*/

#include "App.h"

void App::OnEvent( INPUT_RECORD event_instance ) {
    Event::OnEvent( event_instance );
}

void App::OnKeyDown(int vk_code) {
	switch(vk_code) {
		case VK_LEFT: {
			Player1.MoveLeft = true;
			break;
		}

		case VK_RIGHT: {
			Player1.MoveRight = true;
			break;
		}
		
		case VK_UP: {
			Player1.MoveUp = true;
			break;
		}

		case VK_DOWN: {
			Player1.MoveDown = true;
			break;
		}

		case VK_ESCAPE: {
			Running = false;
			break;
		}
 

		default: {
		}
	}
}

void App::OnKeyUp( int vk_code) {
	switch(vk_code) {
		case VK_LEFT: {
			Player1.MoveLeft = false;
			break;
		}

		case VK_RIGHT: {
			Player1.MoveRight = false;
			break;
		}
		

		case VK_UP: {
			Player1.MoveUp = false;
			break;
		}

		case VK_DOWN: {
			Player1.MoveDown = false;
			break;
		}

		case VK_ESCAPE: {
			Running = false;
			break;
		}

		default: {
		}
	}
}

void App::OnExit() {
	Running = false;
}
